#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define rep(i, a, b) for (int i = (a); i <= (b); i++)
#define per(i, a, b) for (int i = (a); i >= (b); i--)
#define endl '\n'
const int N = 1005;

int n, m;
char g[N][N];
void draw_space(int x, int y, int w) {
  rep(i, x, x + w - 1) rep(j, y, y + w - 1) g[i][j] = ' ';
}
void draw(int x, int y, int m) {
  if (m == 1) {
    g[x][y] = 'X';
    return;
  }
  int w = m / 3;
  draw(x, y, w);
  draw_space(x, y + w, w);
  draw(x, y + w * 2, w);
  draw_space(x + w, y, w);
  draw(x + w, y + w, w);
  draw_space(x + w, y + w * 2, w);
  draw(x + w * 2, y, w);
  draw_space(x + w * 2, y + w, w);
  draw(x + w * 2, y + w * 2, w);
}
void solve() {
  m = 1;
  rep(i, 2, n) m *= 3;
  draw(1, 1, m);
  rep(i, 1, m) {
    rep(j, 1, m) cout << g[i][j];
    cout << endl;
  }
  cout << '-' << endl;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  while ((cin >> n) && n > 0) solve();
  return 0;
}